package Common
{
	
	import flash.display.MovieClip;
	
	public class UILoading
	{
		public var uiMc:MovieClip = null;
		public var width:int = 0;
		public var height:int = 0;
		
		public function UILoading()
		{
			
		}
		
		
		public static var instance:UILoading = null;
		public static function Instance():UILoading
		{
			if ( instance == null )
			{
				instance = new UILoading();
			}
			
			return instance;
		}
		
		
		public function init():void
		{
			//uiMc = new Loading1();
			uiMc.visible = false;
			
			width = uiMc.width;
			height = uiMc.height;
			
			resize();
		}
		
		
		public function visible( b:Boolean ):void
		{
			uiMc.visible = b;
		}
		
		
		public function setText( per:int , n:int , t:String , s:int ):void
		{
			if ( !n )
			{
				n = 1;
			}
			
			uiMc.setText( per , n , t , s );
		}
		
		
		public function resize():void
		{
			uiMc.x = int( RenderManager.instance.stageWidth * 0.5 - width * 0.5 );
			uiMc.y = int( RenderManager.instance.stageHeight * 0.5 - height * 0.5 );
		}
		
	}
}

